package com.xx.java8.chapter2;

import com.xx.java8.domain.Apple;

public class AppleFancyFormatter implements AppleFormatter {
    @Override
    public String accept(Apple apple) {
        String characteristic = apple.getWeight() > 20 ? "heavy" : "light";
        return String.format("A %s %s apple.", characteristic, apple.getColor());
    }
}
